<script setup lang='ts'>
import { onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';

onMounted(() => {
    const route = useRoute()
    // alert(route.params.id)
    // alert(JSON.stringify(route.query))
})

const back = () => {
    const router = useRouter()
    // router.go(-1) // 返回
}

</script>

<template>
    主页
    <button @click="back">返回</button>
</template>

<style scoped></style>